Skip to content

Create the draft release before electron-builder publishes - #6

Merged
flopitaux-ts merged 1 commit into
mainfrom
fix/release-single-draft
Oct 19, 2026
Merged

flopitaux-ts merged 1 commit into
mainfrom
fix/release-single-draft

Conversation

@flopitaux-ts

Copy link
Copy Markdown
Collaborator

v1.8.0 ended up with two draft releases: the log shows `creating GitHub release reason=release doesn't exist` twice, and the assets were split between them.

Cause (electron-builder / electron-publish 26.15.3, as installed): `PublishManager.getOrCreatePublisher` (app-builder-lib/out/publish/PublishManager.js:166) looks up the cache, then `await createPublisher(...)`, then sets the cache. Artifacts that finish together all miss the cache during that await and get separate `GitHubPublisher` instances. Each has its own lazy `_release`, so each runs `getOrCreateRelease()`, sees no release and calls `createRelease()`. With four targets now (dmg/zip × arm64/x64) this became likely.

Fix: a step before the build creates a draft for the pushed tag with `gh release create "$GITHUB_REF_NAME" --draft --verify-tag --title "${GITHUB_REF_NAME#v}"`, skipped if a release for the tag already exists, so re-runs are safe. Signing keychain steps are unchanged.

Why electron-builder reuses it (electron-publish/out/gitHubPublisher.js):

  • `tag` = `githubTagPrefix(info) + version`; no `tagNamePrefix`/`vPrefixedTagName` is configured, so it's `v1.x.y`, which equals `$GITHUB_REF_NAME`.
  • `getOrCreateRelease()` lists `/repos/thoughtspot/spotter-desktop/releases`, and for a release whose `tag_name` matches, `if (release.draft) return release;`. It never creates one in that case, and uploads go to that release's `upload_url`.
  • `releaseType` defaults to `draft` (nothing sets `EP_DRAFT`/`EP_PRE_RELEASE`/`releaseType`), so the release stays a draft for a maintainer to publish, as before.
  • The title matches what electron-builder would have used (`releaseName || version`), e.g. `1.8.0`.

Not exercised with a real tag; it should be checked on the next release (expect no `creating GitHub release` line in the log and one draft).

🤖 Generated with Claude Code

Parallel artifact publishers each found no release for the tag and each
created one, which split v1.8.0's assets across two drafts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@flopitaux-ts
flopitaux-ts merged commit a6884a5 into main Oct 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant